package cn.tjnext.apply.entity;

import cn.tjnext.apply.contants.EntityStatus;
import org.springframework.data.domain.Sort;

import javax.persistence.*;
import java.util.Date;

/**
 * 用户
 * Created by cp on 2017/7/31.
 */
@Entity
@Table(name = "t_user")
public class UserEntity extends AbstractEntity {

    public static final Sort DEFAULT_SORTING = new Sort(Sort.Direction.DESC, "create_time");
    private static final long serialVersionUID = 4616297020513211349L;

    @Id
    @Column(name = "pkid")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long pkId;

    @Column(name = "name")
    private String name;

    @Column(name = "password")
    private String password;

    @Column(name = "address")
    private String address;

    @Column(name = "gender")
    private Integer gender;

    @Column(name = "phone")
    private String phone;

    @Column(name = "card")
    private String card;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "status")
    private Integer status = EntityStatus.NORMAL;

    public Long getPkId() {
        return pkId;
    }

    public void setPkId(Long pkId) {
        this.pkId = pkId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCard() {
        return card;
    }

    public void setCard(String card) {
        this.card = card;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "UserEntity{" +
                "pkId=" + pkId +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", address='" + address + '\'' +
                ", gender=" + gender +
                ", phone='" + phone + '\'' +
                ", card='" + card + '\'' +
                ", createTime=" + createTime +
                ", status=" + status +
                '}';
    }
}
